<template>
    <div>
        <Row style="color: white;" type="flex" justify="space-around">
            <Col span="4">
                <Card style="background-color: #00cc66;height: 80px;">
                    <div style="text-align:center">
                        <h3>正确人员</h3>
                        <h3>{{cardData.success}}</h3>
                    </div>
                </Card>
            </Col>
            <Col span="4">
                <Card style="background-color: #3399ff;height: 80px;">
                    <div style="text-align:center">
                        <h3>错误人员</h3>
                        <h3>{{cardData.error}}</h3>
                    </div>
                </Card>
            </Col>
            <Col span="4">
                <Card style="background-color: #ff9900;height: 80px;">
                    <div style="text-align:center">
                        <h3>密接人员</h3>
                        <h3>{{cardData.mijie}}</h3>
                    </div>
                </Card>
            </Col>
            <Col span="4">
                <Card style="background-color: #ff6600;height: 80px;">
                    <div style="text-align:center">
                        <h3>确诊人员</h3>
                        <h3>{{cardData.quezhen}}</h3>
                    </div>
                </Card>
            </Col>
            <Col span="4">
                <Card style="background-color: gray;height: 80px;">
                    <div style="text-align:center">
                        <h3>待审核人员</h3>
                        <h3>{{cardData.daishenhe}}</h3>
                    </div>
                </Card>
            </Col>
        </Row>
    </div>
</template>

<script>
import { totalAllUserType } from '@/api/statistics'
export default {
  name: 'miniBar',
  props: {},
  data () {
    return {
      cardData: {
        success: null,
        error: null,
        mijie: null,
        quezhen: null,
        daishenhe: null
      }
    }
  },
  methods: {
    success (val) {
      val = this.$common.xeUtils.isEmpty(val) ? '操作成功' : val
      this.$Message.success(val)
    },
    error (data) {
      this.$Message.error({
        content: '操作失败,\n' + data.errmsg
      })
    },
    initAction () {
      // 统计人员状态总数
      totalAllUserType().then(ret => {
        if (ret.data.errcode === 200) {
          this.cardData.success = ret.data.data[1]
          this.cardData.error = ret.data.data[2]
          this.cardData.mijie = ret.data.data[3]
          this.cardData.quezhen = ret.data.data[4]
          this.cardData.daishenhe = ret.data.data[8]
        }
      })
    }
  },
  mounted () {
    this.initAction()
  },
  watch: {},
  computed: {}
}
</script>

<style scoped>
</style>
